package org.school.service;

import com.github.pagehelper.PageInfo;
import org.school.entity.Host;
import org.school.entity.Shop;
import org.school.entity.User;
import org.school.entity.message;
import org.school.staticException.PasswordIncorrectException;
import org.school.staticException.UserNotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

/**
 * (Host)表服务接口
 *
 * @author skyme
 * @since 2022-12-29 00:54:25
 */
public interface HostService {



    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    Host queryById(Integer id);

    /**
     * 分页查询
     *
     * @param host 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */
    Page<Host> queryByPage(Host host, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param host 实例对象
     * @return 实例对象
     */
    Host insert(Host host);

    /**
     * 修改数据
     *
     * @param host 实例对象
     * @return 实例对象
     */
    Host update(Host host);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);

    message register(Host regHost);
    message login(String username, String password) throws UserNotFoundException, PasswordIncorrectException;



    PageInfo<Shop> findShopInfo(String name, int pageNum, int size);
}
